#include <stdio.h>

#define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))

int main()
{
	int xor = 0;

	xor = 0x00002800 | 0x10000000;
	printf("xor = [0x%08x]\n", xor);

	xor = (0x00002bfc | 0x10000000) + 3;
	printf("xor = [0x%08x]\n", xor);

	xor = 1 << 0;
	printf("xor = [0x%08x]\n", xor);

	xor = 1 << 1;
	printf("xor = [0x%08x]\n", xor);

	xor = 1 << 2;
	printf("xor = [0x%08x]\n", xor);

	printf("0x%lx\n", DMA_BIT_MASK(32));
	return 0;
}

#if 0
/*
 * intel
 */


/*
 * arm v8
 */
int main()
{
  400590:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400594:	910003fd 	mov	x29, sp
	int xor = 0;
  400598:	b9001fbf 	str	wzr, [x29, #28]

	xor = 0x00002800 | 0x10000000;
  40059c:	52850000 	mov	w0, #0x2800                	// #10240
  4005a0:	72a20000 	movk	w0, #0x1000, lsl #16
  4005a4:	b9001fa0 	str	w0, [x29, #28]
	printf("xor = [0x%08x]\n", xor);
  4005a8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005ac:	911b4000 	add	x0, x0, #0x6d0
  4005b0:	b9401fa1 	ldr	w1, [x29, #28]
  4005b4:	97ffff9f 	bl	400430 <printf@plt>

	xor = (0x00002bfc | 0x10000000) + 3;
  4005b8:	52857fe0 	mov	w0, #0x2bff                	// #11263
  4005bc:	72a20000 	movk	w0, #0x1000, lsl #16
  4005c0:	b9001fa0 	str	w0, [x29, #28]
	printf("xor = [0x%08x]\n", xor);
  4005c4:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005c8:	911b4000 	add	x0, x0, #0x6d0
  4005cc:	b9401fa1 	ldr	w1, [x29, #28]
  4005d0:	97ffff98 	bl	400430 <printf@plt>

	xor = 1 << 0;
  4005d4:	52800020 	mov	w0, #0x1                   	// #1
  4005d8:	b9001fa0 	str	w0, [x29, #28]
	printf("xor = [0x%08x]\n", xor);
  4005dc:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005e0:	911b4000 	add	x0, x0, #0x6d0
  4005e4:	b9401fa1 	ldr	w1, [x29, #28]
  4005e8:	97ffff92 	bl	400430 <printf@plt>

	xor = 1 << 1;
  4005ec:	52800040 	mov	w0, #0x2                   	// #2
  4005f0:	b9001fa0 	str	w0, [x29, #28]
	printf("xor = [0x%08x]\n", xor);
  4005f4:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4005f8:	911b4000 	add	x0, x0, #0x6d0
  4005fc:	b9401fa1 	ldr	w1, [x29, #28]
  400600:	97ffff8c 	bl	400430 <printf@plt>

	xor = 1 << 2;
  400604:	52800080 	mov	w0, #0x4                   	// #4
  400608:	b9001fa0 	str	w0, [x29, #28]
	printf("xor = [0x%08x]\n", xor);
  40060c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400610:	911b4000 	add	x0, x0, #0x6d0
  400614:	b9401fa1 	ldr	w1, [x29, #28]
  400618:	97ffff86 	bl	400430 <printf@plt>

	printf("0x%x\n", DMA_BIT_MASK(32));
  40061c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400620:	911b8000 	add	x0, x0, #0x6e0
  400624:	b2407fe1 	mov	x1, #0xffffffff            	// #4294967295
  400628:	97ffff82 	bl	400430 <printf@plt>
	return 0;
  40062c:	52800000 	mov	w0, #0x0                   	// #0
}

/*
 * arm v7
 */


#endif
